package com.sbeam.mapper;

import com.sbeam.pojo.Info;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface InfoMapper {
    @Select("select * from info")
    List<Info> getInfo();

    @Select("select count(1) from info")
    long findTotal();

    List<Info> getInfoList1(@Param("start") int start, @Param("size") int size, @Param("query") String query);

    List<Info> getInfoList2(@Param("start") int start, @Param("size") int size, @Param("query") String query);

    @Update("update info set likes=#{likes} where id=#{id}")
    void updateLike(Info info);
    @Update("update info set comment=#{comment} where id=#{id}")
    void saveComment(Info info);
}
